home *** CD-ROM | disk | FTP | other *** search
/ MacFormat España 15 / macformat_15.iso / C de cerca / Codewarrior Lite / MacOS Support / Headers / ANSI Headers / typeinfo < prev    next >
Text File  |  1995-12-29  |  2KB  |  66 lines

  1. /************************************************************************/
  2. /*    Project...:    Standard C++ Library                                    */
  3. /*    Name......:    typeinfo                                                */
  4. /*    Purpose...:    RTTI handling                                            */
  5. /*  Copyright.: ©Copyright 1993-95 by metrowerks inc                    */
  6. /************************************************************************/
  7.  
  8. #ifndef _TYPEINFO_
  9. #define _TYPEINFO_
  10.  
  11. #ifndef _STDEXCEPT_
  12. #include <stdexcept>
  13. #endif
  14.  
  15. #if __MWERKS__
  16. #pragma options align=mac68k
  17.  
  18. #if __CFM68K__ && __USING_IMPORTED_ANSI__
  19. #pragma import on
  20. #endif
  21. #endif
  22.  
  23. class type_info {
  24.     const char    *tname;
  25.     const void    *tbase;
  26.  
  27. public:
  28. //    virtual        ~type_info();
  29.     char        operator==(const type_info&) const;
  30.     char        operator!=(const type_info&) const;
  31.     char        before(const type_info&) const;
  32.     const char*    name() const;
  33.  
  34. private:
  35.                 type_info(const type_info&);
  36.     type_info&    operator=(const type_info&);
  37. };
  38.  
  39. class bad_cast : public exception {
  40. public:
  41.     bad_cast() throw() {}
  42.     bad_cast(const bad_cast&) throw() {}
  43.     bad_cast& operator=(const bad_cast&) throw() { return *this; }
  44. //    virtual ~bad_cast() throw();
  45.     virtual const char* what() const /*throw()*/;
  46. };
  47.  
  48. class bad_typeid : public exception {
  49. public:
  50.     bad_typeid() throw() {}
  51.     bad_typeid(const bad_typeid&) throw() {}
  52.     bad_typeid& operator=(const bad_typeid&) throw() { return *this; }
  53. //    virtual ~bad_typeid() throw();
  54.     virtual const char* what() const /*throw()*/;
  55. };
  56.  
  57. #if __MWERKS__
  58. #if __CFM68K__ && __USING_IMPORTED_ANSI__
  59. #pragma import reset
  60. #endif
  61.  
  62. #pragma options align=reset
  63. #endif
  64.  
  65. #endif
  66.